<script lang="ts" setup>
import navigateTo, { getCurrentPage } from '@/utils/navigator'
import uniNavBar from '@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue';
defineProps<{
  title: string
  color: string
  statusBarBg?: string
}>()

function onClickLeft() {
  const { videoInfo } = storeToRefs( useVideo())
  const id = videoInfo.value?.id || getCurrentPage().options?.id
  navigateTo(`/pages/detail/index?id=${id}`, { isRedirect: true })
}
</script>

<template>
  <uni-nav-bar :title="title" :fixed="true" :color="color" :border="false" left-icon="left" :status-bar="true"
    :status-bar-bg="statusBarBg" @click-left="() => onClickLeft()">
  </uni-nav-bar>
</template>

<style lang="scss" scoped>
:deep(.uniui-left) {
  font-size: 44rpx !important;
}
</style>
